
<form class="well form-horizontal span8" action="<?php echo base_url() . "admin.php/docente/actualizar" ?>" method="post" enctype="multipart/form-data" <?php echo ($opc=='upd'?' ':' onsubmit="return confirmation()"'); ?>>
    <legend>MODIFICAR DATOS DEL DOCENTE</legend>
    <?php foreach ($docente as $i => $doc) { ?>
        <div class="tabbable">
            <ul class="nav nav-tabs">
                <li class="active"><a href="#1" data-toggle="tab">Datos Generales</a></li>
                <li><a href="#2" data-toggle="tab">Datos Docentes</a></li>
            </ul>
            <div class="tab-content">
                <div class="tab-pane active" id="1">

                    <div class="control-group">
                        <label class="control-label" for="select01">Tipo de Documento</label>
                        <div class="controls">

                            <select id="select01"  name="tipo_doc_pers">

                                <option value= "0" <?php echo ($doc['tipo_doc_pers'] == 0 ? " selected" : " "); ?>>CEDULA</option>
                                <option value= "1" <?php echo ($doc['tipo_doc_pers'] == 1 ? " selected" : " "); ?>>PASAPORTE</option>
                                <option value= "2" <?php echo ($doc['tipo_doc_pers'] == 2 ? " selected" : " "); ?>>CARNE DE REFUGIADO</option>
                            </select>

                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label" for="input01">N&uacute;mero de Identificaci&oacute;n</label>
                        <div class="controls">
                            <input type="text" class="input-medium span2"  name="cedula_pers" value= "<?php echo $doc['cedula_pers']; ?>">
                            <li class="icon-asterisk"></li>
                            <div class='MensajeError'>
                                <?php echo form_error('cedula_pers') ?>
                            </div>

                        </div>
                    </div>

                    <div class="control-group">
                        <label class="control-label" for="input02">Nombre Completos</label>
                        <div class="controls">
                            <input type="text" class="input-medium span4"  name="nombre_pers" value= "<?php echo $doc['nombre_pers']; ?>">
                            <li class="icon-asterisk"></li>
                            <div class='MensajeError'>
                                <?php echo form_error('nombre_pers') ?>
                            </div>

                        </div>
                    </div>

                    <div class="control-group">
                        <label class="control-label" for="input03">Apellidos </label>
                        <div class="controls">
                            <input type="text" class="input-medium span4"  name="apellido_pers" value= "<?php echo $doc['apellido_pers']; ?>">
                            <li class="icon-asterisk"></li>
                            <div class='MensajeError'>
                                <?php echo form_error('apellido_pers') ?>
                            </div>

                        </div>
                    </div>

                    <div class="control-group">
                        <label class="control-label" for="input04">Nacionalidad </label>
                        <div class="controls">
                            <input type="text" class="input-medium span3"  name="nacionalidad_pers" value= "<?php echo $doc['nacionalidad_pers']; ?>">
                            <li class="icon-asterisk"></li>
                            <div class='MensajeError'>
                                <?php echo form_error('nacionalidad_pers') ?>
                            </div>

                        </div>
                    </div>

                    <div class="control-group">
                        <label class="control-label" for="input15">Provincia </label>
                        <div class="controls">

                            <select id="select01"  name="provincia_pers">
                                <option <?php echo ($doc['provincia_pers'] == "AZUAY" ? " selected" : " "); ?>>AZUAY</option>
                                <option <?php echo ($doc['provincia_pers'] == "BOLIVAR" ? " selected" : " "); ?>>BOLIVAR</option>
                                <option <?php echo ($doc['provincia_pers'] == "CAÑAR" ? " selected" : " "); ?>>CAÑAR</option>
                                <option <?php echo ($doc['provincia_pers'] == "CARCHI" ? " selected" : " "); ?>>CARCHI</option>
                                <option <?php echo ($doc['provincia_pers'] == "CHIMBORAZO" ? " selected" : " "); ?>>CHIMBORAZO</option>
                                <option <?php echo ($doc['provincia_pers'] == "COTOPAXI" ? " selected" : " "); ?>>COTOPAXI</option>
                                <option <?php echo ($doc['provincia_pers'] == "EL ORO" ? " selected" : " "); ?>>EL ORO</option>
                                <option <?php echo ($doc['provincia_pers'] == "ESMERALDAS" ? " selected" : " "); ?>>ESMERALDAS</option>
                                <option <?php echo ($doc['provincia_pers'] == "GALAPAGOS" ? " selected" : " "); ?>>GALAPAGOS</option>
                                <option <?php echo ($doc['provincia_pers'] == "IMBABURA" ? " selected" : " "); ?>>IMBABURA</option>
                                <option <?php echo ($doc['provincia_pers'] == "LOJA" ? " selected" : " "); ?>>LOJA</option>
                                <option <?php echo ($doc['provincia_pers'] == "LOS RIOS" ? " selected" : " "); ?>>LOS RIOS</option>
                                <option <?php echo ($doc['provincia_pers'] == "MANABI" ? " selected" : " "); ?>>MANABI</option>
                                <option <?php echo ($doc['provincia_pers'] == "MORONA SANTIAGO" ? " selected" : " "); ?>>MORONA SANTIAGO</option>
                                <option <?php echo ($doc['provincia_pers'] == "NAPO" ? " selected" : " "); ?>>NAPO</option>
                                <option <?php echo ($doc['provincia_pers'] == "ORELLANA" ? " selected" : " "); ?>>ORELLANA</option>
                                <option <?php echo ($doc['provincia_pers'] == "PASTAZA" ? " selected" : " "); ?>>PASTAZA</option>
                                <option <?php echo ($doc['provincia_pers'] == "PICHINCHA" ? " selected" : " "); ?>>PICHINCHA</option>
                                <option <?php echo ($doc['provincia_pers'] == "SANTA ELENA" ? " selected" : " "); ?>>SANTA ELENA</option>
                                <option <?php echo ($doc['provincia_pers'] == "SANTO DOMINGO DE LOS TSACHILAS" ? " selected" : " "); ?>>SANTO DOMINGO DE LOS TSACHILAS</option>
                                <option <?php echo ($doc['provincia_pers'] == "SUCUMBIOS" ? " selected" : " "); ?>>SUCUMBIOS</option>
                                <option <?php echo ($doc['provincia_pers'] == "TUNGURAHUA" ? " selected" : " "); ?>>TUNGURAHUA</option>
                                <option <?php echo ($doc['provincia_pers'] == "ZAMORA CHINCHIPE" ? " selected" : " "); ?>>ZAMORA CHINCHIPE</option>


                            </select>

                        </div>                        
                    </div>

                    <div class="control-group">
                        <label class="control-label" for="input05">Cant&oacute;n</label>
                        <div class="controls">
                            <input type="text" class="input-medium span3"  name="canton_pers" value= "<?php echo $doc['canton_pers']; ?>">
                            <li class="icon-asterisk"></li>
                            <div class='MensajeError'>
                                <?php echo form_error('canton_pers') ?>
                            </div>

                        </div>
                    </div>

                    <div class="control-group">
                        <label class="control-label" for="input05">Parroquia</label>
                        <div class="controls">
                            <input type="text" class="input-medium span3"  name="parroquia_pers" value= "<?php echo $doc['parroquia_pers']; ?>">

                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label" for="input05">Barrio</label>
                        <div class="controls">
                            <input type="text" class="input-medium span3"  name="barrio_pers" value= "<?php echo $doc['barrio_pers']; ?>">

                        </div>
                    </div>

                    <div class="control-group">
                        <label class="control-label" for="input06">Direccion del Domicilio</label>
                        <div class="controls">
                            <input type="text" class="input-medium span4"  name="direccion_pers" value= "<?php echo $doc['direccion_pers']; ?>">
                            <li class="icon-asterisk"></li>
                            <div class='MensajeError'>
                                <?php echo form_error('direccion_pers') ?>
                            </div>

                        </div>
                    </div>

                    <div class="control-group">
                        <label class="control-label" for="input07">Referencia del Domicilio</label>
                        <div class="controls">
                            <input type="text" class="input-medium span4"  name="refer_domic_pers" value= "<?php echo $doc['refer_domic_pers']; ?>">

                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label" for="input08">Tipo de Discapacidad</label>
                        <div class="controls">
                            <input type="text" class="input-medium span4"  name="tipo_discap_pers" value= "<?php echo $doc['tipo_discap_pers']; ?>">

                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label" for="input09">Carn&eacute; del CONADIS</label>
                        <div class="controls">
                            <input type="text" class="input-medium span3"  name="conadis_pers" value= "<?php echo $doc['conadis_pers']; ?>">

                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label" for="input010">Porcentaje de Discapacidad</label>
                        <div class="controls">
                            <input type="text" class="input-medium span2"  name="porc_disc_pers" value= "<?php echo $doc['porc_disc_pers']; ?>">

                        </div>
                    </div>

                    <div class="control-group">
                        <label class="control-label" for="select01">Sexo</label>
                        <div class="controls">

                            <select id="select01"  name="sexo_pers">
                                <option <?php echo ($doc['sexo_pers'] == "HOMBRE" ? " selected" : " "); ?>>HOMBRE</option>
                                <option <?php echo ($doc['sexo_pers'] == "MUJER" ? " selected" : " "); ?>>MUJER</option>
                            </select>

                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label" for="select02">Estado Civil</label>
                        <div class="controls">

                            <select id="select02"  name="estado_civil_pers">
                                <option <?php echo ($doc['estado_civil_pers'] == "SOLTERO(A)" ? " selected" : " "); ?>>SOLTERO(A)</option>
                                <option <?php echo ($doc['estado_civil_pers'] == "CASADO(A)" ? " selected" : " "); ?>>CASADO(A)</option>
                                <option <?php echo ($doc['estado_civil_pers'] == "UNION LIBRE" ? " selected" : " "); ?>>UNION LIBRE</option>
                                <option <?php echo ($doc['estado_civil_pers'] == "DIVORCIADO(A)" ? " selected" : " "); ?>>DIVORCIADO(A)</option>
                                <option <?php echo ($doc['estado_civil_pers'] == "VIUDO(A)" ? " selected" : " "); ?>>VIUDO(A)</option>
                                <option <?php echo ($doc['estado_civil_pers'] == "ECLECIASTICO(A)" ? " selected" : " "); ?>>ECLECIASTICO(A)</option>


                            </select>

                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label" for="select12">Autodefinici&oacute;</label>
                        <div class="controls">

                            <select id="select02"  name="autodefin_pers">
                                <option <?php echo ($doc['autodefin_pers'] == "NEGRO" ? " selected" : " "); ?>>NEGRO</option>
                                <option <?php echo ($doc['autodefin_pers'] == "MULATO" ? " selected" : " "); ?>>MULATO</option>
                                <option <?php echo ($doc['autodefin_pers'] == "AFROECUATORIANO" ? " selected" : " "); ?>>AFROECUATORIANO</option>
                                <option <?php echo ($doc['autodefin_pers'] == "INDIGENA" ? " selected" : " "); ?>>INDIGENA</option>
                                <option <?php echo ($doc['autodefin_pers'] == "MESTIZO" ? " selected" : " "); ?>>MESTIZO</option>
                                <option <?php echo ($doc['autodefin_pers'] == "MONTUBIO" ? " selected" : " "); ?>>MONTUBIO</option>
                                <option <?php echo ($doc['autodefin_pers'] == "BLANCO" ? " selected" : " "); ?>>BLANCO</option>
                                <option <?php echo ($doc['autodefin_pers'] == "OTRO" ? " selected" : " "); ?>>OTRO</option>


                            </select>

                        </div>
                    </div>


                    <div class="control-group">
                        <label class="control-label" for="select03">Fecha de Nacimiento</label>
                        <div class="controls">
                            <input type="text" class="input-medium "  id="datepicker" name="fecha_nac_pers" value="<?php echo date("m/d/Y", strtotime($doc['fecha_nac_pers'])); ?>">

                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label" for="input08">N&uacute;mero de tel&eacute;fono</label>
                        <div class="controls">
                            <input type="text" class="input-medium span2"  name="fono_pers" value= "<?php echo $doc['fono_pers']; ?>">

                        </div>
                    </div>

                    <div class="control-group">
                        <label class="control-label" for="input09">N&uacute;mero de celular</label>
                        <div class="controls">
                            <input type="text" class="input-medium span2"  name="celular_pers" value= "<?php echo $doc['celular_pers']; ?>">

                        </div>
                    </div>

                    <div class="control-group">
                        <label class="control-label" for="input10">Correo Electr&oacute;nico Institucional</label>
                        <div class="controls">
                            <input type="text" class="input-medium span3"  name="email_inst_pers" value= "<?php echo $doc['email_inst_pers']; ?>">
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label" for="input11">Fotograf&iacute;a</label>
                        <div class="controls">
                            <img src="<?php echo $doc['foto_pers']; ?>" width="88" height="99" alt="itss1"/>
                        </div>
                    </div>

                    <div class="control-group">
                        <label class="control-label" for="input11">Subir fotograf&iacute;a</label>
                        <div class="controls">
                            <input type="file" class="input-medium span4"  name="foto_pers" value= "<?php echo $doc['foto_pers']; ?>">

                        </div>
                    </div>

                </div>
                <div class="tab-pane" id="2">
                    <div class="control-group">
                        <label class="control-label" for="select03">Categor&iacute;a</label>
                        <div class="controls">

                            <select id="select01"  name="cat_escalofon_doc">
                                <option value="1" <?php echo (($doc["cat_escalofon_doc"] == 1 ? " selected" : "") . ""); ?>>TITULAR PRINCIPAL</option>
                                <option value="2" <?php echo (($doc["cat_escalofon_doc"] == 2 ? " selected" : "") . ""); ?>>TITULAR AGREGADO</option>
                                <option value="3" <?php echo (($doc["cat_escalofon_doc"] == 3 ? " selected" : "") . ""); ?>>TITULAR AUXILIAR</option>
                                <option value="4" <?php echo (($doc["cat_escalofon_doc"] == 4 ? " selected" : "") . ""); ?>>NO TITULAR HONORARIO</option>
                                <option value="5" <?php echo (($doc["cat_escalofon_doc"] == 5 ? " selected" : "") . ""); ?>>NO TITULAR INVITADO</option>
                                <option value="6" <?php echo (($doc["cat_escalofon_doc"] == 6 ? " selected" : "") . ""); ?>>NO TITULAR OCASIONAL</option>


                            </select>

                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label" for="select04">Tipo de Relaci&oacute;n</label>
                        <div class="controls">

                            <select id="select02"  name="tipo_contrato_doc">

                                <option value="1" <?php echo (($doc["tipo_contrato_doc"] == 1 ? " selected" : "") . ""); ?>>CONTRATO</option>
                                <option value="2" <?php echo (($doc["tipo_contrato_doc"] == 2 ? " selected" : "") . ""); ?>>SERVICIOS PROFESIONALES</option>
                            </select>

                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label" for="select14">Concuso de Meritos</label>
                        <div class="controls">

                            <select id="select02"  name="concurso_doc">
                                <option value="0" <?php echo ($doc["concurso_doc"] == 0 ? "selected" : " ") ; ?>>SI</option>
                                <option value="1" <?php echo ($doc["concurso_doc"] == 1 ? "selected" : " "); ?>>NO</option>
                            </select>

                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label" for="select14">Dedicaci&oacute;n</label>
                        <div class="controls">

                            <select id="select02"  name="dedicacion_doc">
                                <option value="1" <?php echo (($doc["dedicacion_doc"] == 1 ? " selected" : "") . ""); ?>>TIEMPO COMPLETO</option>
                                <option value="2" <?php echo (($doc["dedicacion_doc"] == 2 ? " selected" : "") . ""); ?>>TIEMPO PARCIAL</option>
                                <option value="3" <?php echo (($doc["dedicacion_doc"] == 3 ? " selected" : "") . ""); ?>>HORAS</option>
                            </select>

                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label" for="select15">Cursa Estudios</label>
                        <div class="controls">

                            <select id="select02"  name="cursa_estudios_doc">
                                <option value="1" <?php echo (($doc["cursa_estudios_doc"] == 1 ? " selected" : "") . ""); ?>>NINGUNO</option>
                                <option value="2" <?php echo (($doc["cursa_estudios_doc"] == 2 ? " selected" : "") . ""); ?>>MAESTRIA</option>
                                <option value="3" <?php echo (($doc["cursa_estudios_doc"] == 3 ? " selected" : "") . ""); ?>>DOCTORADO</option>
                                <option value="4" <?php echo (($doc["cursa_estudios_doc"] == 4 ? " selected" : "") . ""); ?>>TERCER NIVEL</option>
                            </select>

                        </div>
                    </div>      
                    <div class="control-group">
                        <label class="control-label" for="input05">Fecha Ingreso1</label>
                        <div class="controls">
                            <input type="text" class="input-medium"  id="datepicker1" name="fecha_ingreso1_doc" value="<?php echo date("m/d/Y", strtotime($doc['fecha_ingreso1_doc'])); ?>">

                        </div>
                    </div>

                    <div class="control-group">
                        <label class="control-label" for="input05">Fecha de Salida1</label>
                        <div class="controls">
                            <input type="text" class="input-medium "  id="datepicker2" name="fecha_salida1_doc" value="<?php echo date("m/d/Y", strtotime($doc['fecha_salida1_doc'])); ?>">
                        </div>
                    </div>

                    <div class="control-group">
                        <label class="control-label" for="input06">Fecha de Ingreso2</label>
                        <div class="controls">
                            <input type="text" class="input-medium"  id="datepicker3" name="fechaingeso2_doc" value="<?php echo date("m/d/Y", strtotime($doc['fechaingeso2_doc'])); ?>">

                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label" for="input07">Fecha de Salida2</label>
                        <div class="controls">
                            <input type="text" class="input-medium "  id="datepicker4" name="fecha_salida2_doc" value="<?php echo date("m/d/Y", strtotime($doc['fecha_salida2_doc'])); ?>">

                        </div>
                    </div>

                    <div class="control-group">
                        <label class="control-label" for="input08">Fecha de Ingreso3</label>
                        <div class="controls">
                            <input type="text" class="input-medium"  id="datepicker5" name="fecha_ingreso3_doc" value="<?php echo date("m/d/Y", strtotime($doc['fecha_ingreso3_doc'])); ?>">


                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label" for="input08">Fecha de Salida3</label>
                        <div class="controls">
                            <input type="text" class="input-medium"  id="datepicker6" name="fecha_salida3_doc" value="<?php echo date("m/d/Y", strtotime($doc['fecha_salida3_doc'])); ?>">


                        </div>
                    </div>

                    <div class="control-group">
                        <label class="control-label" for="select07">Activo</label>
                        <input type="checkbox" name="activo_doc" value="1" <?php echo ($doc["activo_doc"] == 1 ? "checked='checked'" : ""); ?> />

                    </div>
                </div>
            </div>
        </div>
    <?php } ?>
    <?php if (isset($msj_error)) { ?>
        <div class='MensajeError'>
            <?php echo ($msj_error); ?>
        </div>
    <?php } ?>

    <fieldset>
        <div class="control-group"> 
            <div class="controls">
                <input type="hidden" name="persona_ide_pers" value="<?php echo $doc["persona_ide_pers"]; ?>">

            </div>
        </div >
    </fieldset>

    <fieldset>
        <div class="control-group"> 
            <div class="controls">
                <input type="hidden"  name="txtopc" value="<?php echo $opc; ?>">

            </div>
        </div >
    </fieldset>
    <div class="control-group"> 
        <div class="controls">
            <input type="hidden" name="foto_pers" value="<?php echo $doc["foto_pers"]; ?>">

        </div>
    </div >
</fieldset>


<div class="controls">
    <?php if ($opc == 'upd') { ?>
        <button type="submit" class="btn">Modificar Datos</button>

    <?php } else { ?>
        <button type="submit" class="btn">Eliminar Datos</button>
    <?php } ?>
    <a href="<?php echo base_url() . "admin.php/docente/inicio" ?>">
        <img src="<?php echo base_url(); ?>commons/images/boton_volver.gif"></a>

</div> 



</form>

